package com.hecate.common.db.basedao.insert;

import com.hecate.common.db.basedao.provider.insert.HecateBaseInsertProvider;
import com.hecate.common.db.basedo.IBase;
import org.apache.ibatis.annotations.InsertProvider;
import tk.mybatis.mapper.annotation.RegisterMapper;

/**
 * @author 黄星星
 * @date 2020-12-17
 */
@RegisterMapper
public interface HecateInsertSelectiveDao<T extends IBase> {

    /**
     * 保存一个实体，null的属性不会保存，会使用数据库默认值
     *
     * @param record
     * @return
     */
    @InsertProvider(type = HecateBaseInsertProvider.class, method = "dynamicSQL")
    int insertSelective(T record);
}
